<template>
	<view class="page" style="height:100vh;background: #ededed;">
		<free-nav-bar showback :showright="false" title="好友申请列表">


		</free-nav-bar>
		<free-list-item v-for="item in row" showright
			:cover="item.user.avatar? item.user.avatar:'/static/images/mail/friend.png'" :title="item.user.username">

			<view v-if="item.status == 'pending'" @click="agree(item.user_id)" slot="right" class="main-bg-color rounded mr-3 px-2 py-1">
				<text class="font text-white">同意</text>


			</view>
			<view v-if="item.status == 'agree'" class="font-sm text-muted" slot="right">已通过验证</view>
			<view v-if="item.status == 'ignore'" slot="right">已忽略</view>
			<view v-if="item.status == 'refuse'" slot="right">已拒绝</view>
		</free-list-item>
	</view>
</template>

<script>
	import freeNavBar from "@/components/free-ui/free-nav-bar.vue"
	import freeListItem from "@/components/free-ui/free-list-item.vue"
	import $H from '../../../utils/request.js';
	import {
		mapState
	} from "vuex"
	export default {
		components: {
			freeNavBar,
			freeListItem
		},
		data() {
			return {
				form: {
					friend_id: 0,
					nickname: "",
					lookme: false,
					lookhim: false,

				}
			}
		},
		onLoad() {
			console.log(this.row, "roiw")
		},
		computed: {
			...mapState({
				row: state => state.user.apply.res
			})
		},
		methods: {
			agree(e){
				uni.navigateTo({
					url:"/pages/mail/addFriend/addFriend?text='同意好友'&&id="+e
				})
			}
		}
	}
</script>

<style>

</style>
